import { View } from "../../../mvc/core/View";
import { SLadderPlayerResult } from "../../../../Message/Public/SLadderPlayerResult";
import { ObjTeamCreate } from "../common/ObjTeamCreate";
import { Language } from "../../../../extend/language/Language";
import { Cache } from "../../cache/Cache";
import { GTextFormat } from "../../../common/GTextFormat";
import { FontUtil } from "../../../common/font/FontUtil";
import { ObjCreate } from "../common/ObjCreate";
import { GlobalStyle } from "../../../common/global/GlobalStyle";
import { GTextFiled } from "../../../../com/mui/controls/GTextFiled";
//class LadderBattlefieldPlayerResult
    
    export  class LadderBattlefieldPlayerResult extends View
    {
        constructor()
        {
            super();
            return;
        }

        public updateResult(arg1: SLadderPlayerResult, arg2: Boolean=false): void
        {
            this._tfName.text = arg1.miniPlayer.name;
            this._tfName.x = 70;
            this._tfName.y = 12;
            this._tfLevel.text = "LV." + arg1.miniPlayer.level.toString();
            ObjTeamCreate.setTextFieldKeyValue(this._tfPower, Language.getString(28831), arg1.leftLife.toString());
            ObjTeamCreate.setTextFieldKeyValue(this._tfTotalHurt, Language.getString(42239), arg1.totalHurt.toString());
            ObjTeamCreate.setTextFieldKeyValue(this._tfTotalCure, Language.getString(42240), arg1.totalCure.toString());
            this._tfScoreReward.text = Language.getStringByParam(42236, arg1.markAdd.toString());
            if (arg1.miniPlayer.name == Cache.instance.role.entityInfo.name) 
            {
                this._tfScoreReward.text = Language.getStringByParam(42236, arg1.markAdd.toString());
            }
            this._tfScoreTotelReward.text = Language.getStringByParam(42237, arg1.mark.toString());
            return;
        }

        public /* override */ createDisposedChildren(): void
        {
            super.createDisposedChildren();
            var loc1=new GTextFormat(FontUtil.songtiName, 14, 15788607);
            this._tfName = ObjCreate.createTextField("", 70, 12, 120, 22, this, loc1);
            this._tfLevel = ObjCreate.createTextField("", 70, 35, 50, 20, this, GlobalStyle.textFormat2);
            this._tfPower = ObjCreate.createTextField("", 30, 55, 120, 20, this);
            this._tfTotalHurt = ObjCreate.createTextField("", 30, 72, 120, 20, this);
            this._tfTotalCure = ObjCreate.createTextField("", 30, 90, 120, 20, this);
            this._tfScoreReward = ObjCreate.createTextField(Language.getStringByParam(42236, "0"), 22, 115, 150, 22, this, loc1);
            this._tfScoreTotelReward = ObjCreate.createTextField(Language.getStringByParam(42237, "0"), 22, 135, 150, 22, this, loc1);
            return;
        }

        /* internal */ /* var */_tfName: GTextFiled;

        /* internal */ /* var */_tfLevel: GTextFiled;

        /* internal */ /* var */_tfPower: GTextFiled;

        /* internal */ /* var */_tfTotalHurt: GTextFiled;

        /* internal */ /* var */_tfTotalCure: GTextFiled;

        /* internal */ /* var */_tfScoreReward: GTextFiled;

        /* internal */ /* var */_tfScoreTotelReward: GTextFiled;
    }
